package com.base.cn.platform.os;

import org.springframework.boot.WebApplicationType;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.scheduling.annotation.EnableScheduling;


/**
 * 省略了在主函数上添加 @EnableDiscoveryClient Spring Cloud默认认为客户端是要完成向注册中心进行注册的
 * 如果控制不需要向Eureka Server发起注册将该值设置为false,默认值为true; spring.cloud.service-registry.auto-registration.enabled = xxx
 */
@EnableScheduling
@EnableFeignClients //启用Feign
@SpringBootApplication
@EnableAsync
public class CourseApplication extends SpringBootServletInitializer {

    public static void main( String[] args ){
        new SpringApplicationBuilder(CourseApplication.class).web(WebApplicationType.SERVLET).run(args);
    }

    @Override
    protected SpringApplicationBuilder configure(SpringApplicationBuilder builder) {
        return builder.sources(CourseApplication.class);
    }
}
